]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
loginDialog: Don't reconnect on each reset with gdmClient
authorJoan Torres López <joantolo@redhat.com>
Wed, 11 Jun 2025 15:46:07 +0000 (17:46 +0200)
committerJoan Torres López <joantolo@redhat.com>
Wed, 11 Jun 2025 15:46:07 +0000 (17:46 +0200)
When resetting the greeter proxy, it's destroyed and then recreated
again.

This destroy/recreate thing doesn't give any info to GDM and the greeter
interface destroyed has the same state as the newly created one.

Each time get_greeter_sync is called when greeter is destroyed makes GDM
create a new connection which stores in a list. This means that for each
reset a new unnecessary connection is created and stored.

GDM was leaking some objects which combined with this excessive connection
creation was causing a fd leak on each reset.

To make better use of resources and avoid problems, use ensure instead
of reset greeter proxy.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3749>

js/gdm/loginDialog.js

index 44dad333f55321f14813a2cba941e4dc4682eb61..15ba43a351e666c5eeb04903ffbf5500091c02b2 100644 (file)
@@ -990,10 +990,10 @@ export const LoginDialog = GObject.registerClass({
         this._showPrompt();
     }
 
-    _resetGreeterProxy() {
+    _ensureGreeterProxy() {
         if (GLib.getenv('GDM_GREETER_TEST') !== '1') {
             if (this._greeter)
-                this._greeter.run_dispose();
+                return;
 
             this._greeter = this._gdmClient.get_greeter_sync(null);
 
@@ -1005,7 +1005,7 @@ export const LoginDialog = GObject.registerClass({
     }
 
     _onReset(authPrompt, beginRequest) {
-        this._resetGreeterProxy();
+        this._ensureGreeterProxy();
         this._sessionMenuButton.updateSensitivity(true);
 
         const previousUser = this._user;